//
// Created by 吴喆 on 2020/3/18.
//

#ifndef SUMMER_FLOOR_H
#define SUMMER_FLOOR_H


#import <box2d/box2d.h>
#import <glm/glm.hpp>
#import <string>
#import "ResourceManager.h"
#import "World.h"
#import "Texture.h"
#import "Renderer.h"
#include "GameObject.h"

class Floor : public GameObject {
public:
    Floor(Scene *scene, int rowNum, int n, std::string &textureId, float rxy1, float ry2, World *world,
          bool isBottom = true, bool hFlip = false, bool vFlip = false);

    Floor(Scene *scene, int rowNum, int n, std::string &textureId, bool hFlip = false, bool vFlip = false);

    virtual ~Floor();

    void render() override;

    void update() override {};

    virtual void init();

    virtual void initBox() {};

    void initGameObject() override;

    bool isBottom;
    bool vFlip;
    bool hFlip;
protected:
    glm::vec2 position;
    glm::vec2 size;
    b2Body *body = nullptr;
    Texture2D *texture = nullptr;

};


#endif //SUMMER_FLOOR_H
